﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace Dogs
{
    static class DateUtil
    {
        public static bool IsDateEqual(DateTime date1, DateTime date2)
        {
            bool isYearEqual = date1.Year == date2.Year;
            bool isMonthEqual = date1.Month == date2.Month;
            bool isDayEqual = date1.Day == date2.Day;

            return (isYearEqual && isMonthEqual && isDayEqual);
        }

        public static bool IsFirstDateLater(DateTime date1, DateTime date2)
        {
            bool isYearLater = date1.Year > date2.Year;
            bool isMonthLater = date1.Month > date2.Month;
            bool isDayLater = date1.Day > date2.Day;

            if (isYearLater)
            {
                return true;
            }
            else if (isMonthLater && (date1.Year == date2.Year))
            {
                return true;
            }
            else if (isDayLater && ((date1.Month == date2.Month) && (date1.Year == date2.Year)))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public static string GetYearMonthDay(DateTime date)
        {
            string dateString = "";
            System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo();

            dateString = mfi.GetMonthName(date.Month) + " ";
            dateString += date.Day.ToString() + " ";
            dateString += date.Year.ToString();

            return dateString;
        }
    }
}
